package movieGandalf.GUI;

import movieGandalf.logicGuiConnection.User;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;


public class MyPage extends Composite {


        private static final int MARGIN = 10;
        private static final int TITLE_SPACING = 6;
        private static final int TABLE_SPACING = 105;
        private static final int TABLE_WIDTH = 200;
        private static final int MOVIE_WIDTH = 200;


        private Table tableWatchList;
        private Table tableSeenList;
        private Table tableMustSeeList;
        
        private User user;

        public MyPage(Composite parent, int style, User user) {
                super(parent, style);
                
                this.user=user;
                
                setLayout(new FormLayout());

                Label lblWatchList = new Label(this, SWT.NONE);
                FormData fd_lblWatchList = new FormData();
                fd_lblWatchList.top = new FormAttachment(0, MARGIN);
                fd_lblWatchList.left = new FormAttachment(0, MARGIN);
                lblWatchList.setLayoutData(fd_lblWatchList);
                lblWatchList.setText("Watch List:");


                tableWatchList = new Table(this, SWT.BORDER | SWT.FULL_SELECTION
                                | SWT.VIRTUAL);

                tableWatchList.setHeaderVisible(true);
                tableWatchList.setLinesVisible(true);
                FormData fd_tableWatchList = new FormData();
                fd_tableWatchList.bottom = new FormAttachment(100, -MARGIN);
                fd_tableWatchList.top = new FormAttachment(lblWatchList, TITLE_SPACING);
                fd_tableWatchList.left = new FormAttachment(lblWatchList, 0, SWT.LEFT);
                tableWatchList.setLayoutData(fd_tableWatchList);

                TableColumn tblclmnMovieName = new TableColumn(tableWatchList, SWT.NONE);
                tblclmnMovieName.setResizable(false);
                tblclmnMovieName.setWidth(MOVIE_WIDTH);
                tblclmnMovieName.setText("Name");

                tableWatchList.pack();
                
                
                Label lblSeen = new Label(this, SWT.NONE);
                FormData fd_lblSeen = new FormData();
                fd_lblSeen.top = new FormAttachment(0, MARGIN);
                fd_lblSeen.left = new FormAttachment(tableWatchList, TABLE_SPACING);
                lblSeen.setLayoutData(fd_lblSeen);
                lblSeen.setText("Seen List:");
                
                tableSeenList = new Table(this, SWT.BORDER | SWT.FULL_SELECTION
                                | SWT.VIRTUAL);

                tableSeenList.setHeaderVisible(true);
                tableSeenList.setLinesVisible(true);
                FormData fd_tableSeenList = new FormData();
                fd_tableSeenList.bottom = new FormAttachment(100, -MARGIN);
                fd_tableSeenList.top = new FormAttachment(lblWatchList, TITLE_SPACING);
                fd_tableSeenList.left = new FormAttachment(tableWatchList, TABLE_SPACING);
                fd_tableSeenList.width = TABLE_WIDTH;
                tableSeenList.setLayoutData(fd_tableSeenList);

                TableColumn tblclmnMovieNameS = new TableColumn(tableSeenList, SWT.NONE);
                tblclmnMovieNameS.setResizable(false);
                tblclmnMovieNameS.setWidth(MOVIE_WIDTH);
                tblclmnMovieNameS.setText("Name");

                tableSeenList.pack();
                                
                
                Label lblMustSee = new Label(this, SWT.NONE);
                FormData fd_lblMustSee = new FormData();
                fd_lblMustSee.top = new FormAttachment(0, MARGIN);
                fd_lblMustSee.left = new FormAttachment(tableSeenList, TABLE_SPACING);
                lblMustSee.setLayoutData(fd_lblMustSee);
                lblMustSee.setText("Must See List:");
                
                tableMustSeeList = new Table(this, SWT.BORDER | SWT.FULL_SELECTION
                                | SWT.VIRTUAL);

                tableMustSeeList.setHeaderVisible(true);
                tableMustSeeList.setLinesVisible(true);
                FormData fd_tableMustSeeList = new FormData();
                fd_tableMustSeeList.bottom = new FormAttachment(100, -MARGIN);
                fd_tableMustSeeList.top = new FormAttachment(lblWatchList, TITLE_SPACING);
                fd_tableMustSeeList.right = new FormAttachment(100, -MARGIN);
                fd_tableMustSeeList.width = TABLE_WIDTH;
                tableMustSeeList.setLayoutData(fd_tableMustSeeList);

                TableColumn tblclmnMovieNameMS = new TableColumn(tableMustSeeList, SWT.NONE);
                tblclmnMovieNameMS.setResizable(false);
                tblclmnMovieNameMS.setWidth(MOVIE_WIDTH);
                tblclmnMovieNameMS.setText("Name");

                tableMustSeeList.pack();
        }
}